﻿@model dynamic

@{
    ViewBag.Title = "教程";
}

<h2>@ViewBag.Message</h2>
@{
    string name = "gqq";
    int id = 3;

    Dictionary<string, string> lstProducts = new Dictionary<string, string> {{"key1", "value1"}, {"key2", "value2"}, {"key3", "value3"}};
}

我的名字是 @name,我的学号是 @id 
@Html.ActionLink(@name, "Index");
<a href="http://@(name+".mvc.com")">我的网站</a>

<ul>
    @foreach (var lstProduct in lstProducts)
    {
        <li>@lstProduct.Key —— @lstProduct.Value</li>
    }
</ul>

@if(lstProducts.Count==0)
{
    <p>这里没有产品！</p>
}
else
{
  <p>总共有 @lstProducts.Count 个产品</p>
}

@section footer{
    footer测试完成！
}